Skip to content

W-22203426: feat: promote agent test run-eval to GA and delegate logic to @salesforce/agents#413

Open
andresrivas-sf wants to merge 3 commits intomainfrom
afr/W-22203426/eval-refactor-to-library
Open

W-22203426: feat: promote agent test run-eval to GA and delegate logic to @salesforce/agents#413
andresrivas-sf wants to merge 3 commits intomainfrom
afr/W-22203426/eval-refactor-to-library

Conversation

@andresrivas-sf
Copy link
Copy Markdown
Contributor

Summary

@W-22203426@

  • Removes local copies of evalNormalizer.ts, evalFormatter.ts, and yamlSpecTranslator.ts — these now live in @salesforce/agents
  • Rewrites run-eval.ts as a thin CLI shell that imports normalizePayload, translateTestSpec, resolveAgent, executeBatches, buildResultSummary, and formatResults from @salesforce/agents
  • Promotes the command from state='beta'/hidden to state='ga'
  • Adds comprehensive unit tests for the command (22 tests) using esmock to mock @salesforce/agents

Depends on: forcedotcom/agents#276 being merged and version bumped before this can be fully consumed from npm. Local development uses yarn link "@salesforce/agents".

Test plan

  • yarn compile passes
  • yarn test passes including the new test/commands/agent/test/run-eval.test.ts
  • sf agent test run-eval --help shows the command without (beta) label
  • End-to-end smoke test: run eval against a known agent spec

🤖 Generated with Claude Code

andresrivas-sf and others added 3 commits May 5, 2026 13:46
…o @salesforce/agents

W-22203426

Removes local copies of evalNormalizer, evalFormatter, and yamlSpecTranslator
now that they live in the shared library. Rewrites run-eval.ts as a thin CLI
shell that imports normalizePayload, translateTestSpec, resolveAgent,
executeBatches, buildResultSummary, and formatResults from @salesforce/agents.
Promotes the command from state='beta'/hidden to state='ga'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove state='ga' (GA commands omit state to avoid oclif help regression)
- Remove unused --wait flag
- Wrap parseTestSpec/translateTestSpec in try/catch for named SfError
- Validate test.steps is an array before injection loop
- Hoist isYamlTestSpec to avoid double-call
- Extract resolveAndInjectAgent helper to stay within complexity limit
- Fix test stubs to use $$.SANDBOX, remove sinon.restore(), fix describe label

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…emoval

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@andresrivas-sf andresrivas-sf requested a review from a team as a code owner May 5, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant